import request from '@/utils/request'

export default {

  /**
   * 根据课程id和token中的用户id生成订单信息
   * @param {课程id} courseId 
   * @returns 
   */
  createOrder(courseId) {
    return request({
      url: `/eduorder/order/createOrder/${courseId}`,
      method: 'post',
    })
  },


  /**
   * 根据订单id查询订单信息   
   * @param {订单id} orderId 
   * @returns 
   */
  getOrderInfoById(orderId) {
    return request({
      url: `/eduorder/order/getOrderInfoById/${orderId}`,
      method: 'get'
    })
  },


  /**
   * 查询订单支付状态
   * @param {订单id} orderId 
   * @returns map集合
   */
  getPayStatus(orderId) {
    return request({
      url: `/eduorder/paylog/queryPayStatus/${orderId}`,
      method: 'get'
    })
  },


  /**
   * 生成支付二维码
   * @param {订单编号} orderId 
   * @returns map集合
   */
  createQrCode(orderId) {
    return request({
      url: `/eduorder/paylog/createQrCode/${orderId}`,
      method: 'get'
    })
  },

  
  queryBuyStatus(userId,courseId){
    return request({
      url: `/eduorder/order/queryBuyStatus/${userId}/${courseId}`,
      method: 'get'
    })
  }




}